#include<bits/stdc++.h>
#define ll long long
#define ull unsigned long long
using namespace std;
using i64 = long long;
const int mod = 1000000007;

const int N = 1e6 + 10, INF = 0x3f3f3f3f;
i64 ans, cnt;
i64 inv[N];
i64 n, m;

void solve()
{
    ans = 1;
    cnt = 0;
    inv[0] = 0, inv[1] = 1;
    for (int i = 2;i <= N;i++) {
        inv[i] = (mod - mod / i) * inv[mod % i] % mod;
    }
    while (cin >> n >> m) {
        ans = 1;
        cnt = 0;
        for (int i = 1;i <= m;i++) {
            ans = (ans * i) % mod;
        }
        cnt = (cnt + ans) % mod;
        for (int i = 2;i <= n;i++) {
            ans = ((ans * inv[i - 1]) % mod * (i + m - 1)) % mod;
            cnt = (cnt + ans) % mod;
        }
        cout << cnt << '\n';
    }
}

signed main()
{
    //ios::sync_with_stdio(0);
    //cin.tie(0);cout.tie(0);
#define ONLINE_JUDGE
#ifndef ONLINE_JUDGE
    std::istringstream in(R"()");
    std::cin.rdbuf(in.rdbuf());
#endif
    int T = 1;
    //cin >> T;
    for (int i = 1;i <= T;i++) {
        solve();
    }
}